package com.kingyea.mobilepolice.apimanage.utils;


import com.kingyea.mobilepolice.util.GlobalVarComm;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author Mr.Lin
 * @version v1.0.0
 * @description 全局常量
 * @date Created in 201-1-1 00:15:41
 */

@Component
@ConfigurationProperties(prefix = "kingyea.mobilepolice.apimanage")
//@PropertySource(value = {"classpath:application.properties"},encoding="UTF-8")// 依赖set方法
public class GlobalVar extends GlobalVarComm {

    public final static String TOKENNAME = "token";
    public final static String ACCESS_TOKENNAME = "access_token";

    /**
     * activemq 相关
     */
    @Value("${kingyea.mobilepolice.apimanage.MQ_BROKER_URL}")
    public static String MQ_BROKER_URL = "";//tcp://localhost:61616
    @Value("${kingyea.mobilepolice.apimanage.MQ_SUBJECT}")
    public static String MQ_SUBJECT = "";//InvokedMethod.querer
    @Value("${kingyea.mobilepolice.apimanage.MQ_USERNAME}")
    public static String MQ_USERNAME = "";//user
    @Value("${kingyea.mobilepolice.apimanage.MQ_PASSWORD}")
    public static String MQ_PASSWORD = "";//123

    //    @Value("${kingyea.mobilepolice.apimanage.accesscontrol.usingCheck}")
    public static Boolean usingCheck;

    //    @Value("${kingyea.mobilepolice.apimanage.accesscontrol.usingEncrypt}")
    public static Boolean usingEncrypt;

    public static String getMqBrokerUrl() {
        return MQ_BROKER_URL;
    }

    public void setMqBrokerUrl(String mqBrokerUrl) {
        MQ_BROKER_URL = mqBrokerUrl;
    }

    public static String getMqSubject() {
        return MQ_SUBJECT;
    }

    public void setMqSubject(String mqSubject) {
        MQ_SUBJECT = mqSubject;
    }

    public static String getMqUsername() {
        return MQ_USERNAME;
    }

    public void setMqUsername(String mqUsername) {
        MQ_USERNAME = mqUsername;
    }

    public static String getMqPassword() {
        return MQ_PASSWORD;
    }

    public void setMqPassword(String mqPassword) {
        MQ_PASSWORD = mqPassword;
    }

    public static Boolean getUsingCheck() {
        return usingCheck;
    }

    @Value("${kingyea.mobilepolice.apimanage.accesscontrol.usingCheck}")
    public void setUsingCheck(Boolean usingCheck) {
        GlobalVar.usingCheck = usingCheck;
    }

    public static Boolean getUsingEncrypt() {
        return usingEncrypt;
    }

    @Value("${kingyea.mobilepolice.apimanage.accesscontrol.usingEncrypt}")
    public void setUsingEncrypt(Boolean usingEncrypt) {
        GlobalVar.usingEncrypt = usingEncrypt;
    }
}
